package com.foreknow.view;

import com.foreknow.bean.User;
import com.foreknow.dao.UserDao;
import com.foreknow.dao.impl.UserDaoImpl;
import com.foreknow.service.UserService;
import com.foreknow.service.impl.UserServiceImpl;
import sun.nio.cs.US_ASCII;

public class MainWindow {
    public static void main(String[] args) {
        UserServiceImpl userService = new UserServiceImpl();
        UserDao userDao = new UserDaoImpl();
        //调用set方法给userDao进行初始化
        userService.setUserDao(userDao);
        User user = new User();
        user.setUid("p28794");
        user.setName("tony");
        user.setAge(26);
        //调用service层的方法
        userService.save(user);
    }
}
